package second;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
public class SetBeanValue extends HttpServlet{
	@Override
	protected void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException {
		request.setCharacterEncoding("gb2312");
		BookInfo bookinfo=new BookInfo();
		try {
			BeanUtils.populate(bookinfo, request.getParameterMap());
		}catch(IllegalAccessException iae) {
			
		}catch(InvocationTargetException ite) {
			
		}
		HttpSession session=request.getSession();
		session.setAttribute("bookinfo", bookinfo);
		response.sendRedirect("dispbeanvalue.jsp");
	}
}
